import nyNetwork from "@/api/nyBaseNetwork";

class DZModelExportInfo {

    /**
     * 专家ID
     */
    id = '';

    /**
     * 专家姓名
     */
    name = '';

    /**
     * 头像ID
     */
    heard = '';

    /**
     * 头像路径
     */
    heard_url = '';

    /**
     * 专家介绍
     */
    introduce = '';

    /**
     * 咨询对象
     */
    target = '';

    target_list = [];

    /**
     * 咨询主题
     */
    theme = '';

    theme_list = [];

    /**
     * 擅长疗法
     */
    field = '';

    field_list = [];

    /**
     * 受训经历
     */
    experience = '';

    /**
     * 资历资质
     */
    qualifications = '';

    /**
     * 省名称
     */
    province = '';

    /**
     * 市名称
     */
    city = '';

    /**
     * 星期
     */
    week = '';

    week_list = [];

    /**
     * 时间段的JSON
     */
    time = '';

    time_list = [{ start: '', end: '' }];

    /**
     * 专家状态：0-待认证，1-认证通过
     */
    status = 0;

    /**
     * 冻结状态：0-冻结，1-正常
     */
    frozen = 0;

    /**
     * 排序
     */
    sort = 0;

    /**
     * 置顶
     */
    top = 0;

    parse(data) {
        this.id = data.iId ?? '';
        this.name = data.sName ?? '';
        this.heard = data.iHeard ?? '';
        if (data.iHeard) {
            this.heard_url = nyNetwork.image(data.iHeard)
        }
        this.introduce = data.sIntroduce ?? '';
        this.target = data.sTarget ?? '';
        this.target_list = this.target.split(",");
        this.theme = data.sTheme ?? '';
        this.theme_list = this.theme.split(",");
        this.field = data.sField ?? '';
        this.field_list = this.field.split(",");
        this.experience = data.sExperience ?? '';
        this.qualifications = data.sQualifications ?? '';
        this.province = data.sProvince ?? '';
        this.city = data.sCity ?? '';
        this.week = data.sWeek ?? '';
        if (this.week) {
            for (const week of this.week.split(",")) {
                this.week_list.push(parseInt(week))
            }
        }
        this.time = data.sTimeSlot ?? '';
        this.time_list = JSON.parse(this.time);
        this.status = data.iStatus ?? '';
        this.frozen = data.iFrozen ?? '';
        this.sort = data.iSort ?? 0;
    }
}
export default DZModelExportInfo;